﻿using lingopen.IdStrategy;
using lingopen.Entity;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Chloe;
using lingopen.AutoMapper;
using lingopen.Entity.System;

namespace lingopen.Application.Implements
{
    public class WorkflowTemplatesAppService : AdminAppService, IWorkflowTemplatesAppService
    {
        public PagedData<Sys_WorkflowTemplate> GetList(Pagination pagination, string keyword)
        {
            var q = this.DbContext.Query<Sys_WorkflowTemplate>().FilterDeleted().WhereIfNotNullOrEmpty(keyword, a => a.Name.Contains(keyword) || a.Description.Contains(keyword));
            q = q.OrderBy(a => a.Name);
            PagedData<Sys_WorkflowTemplate> ret = q.TakePageData(pagination);
            return ret;
        }
    }
}
